// pages/personal/personal.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    city: "重庆"
  },

  look: function(e) {
  var url = e.currentTarget.dataset.url
  wx.setStorageSync('lookUrl', url)
    wx.navigateTo({
      url: '../look/look'
    })

  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    this.personalWebsite()
    var _this = this
    wx.getStorage({
      key: 'cityName',
      success: function(res) {
        console.log(res.data)
        _this.setData({
          city: res.data
        })
      }
    })

  },

  personalWebsite: function() {
    var that = this
    wx.showLoading({
      title: '加载中',
    })
    wx.request({
      url: 'https://miniapp.odeman.com/summercamp/userpic.php',
      data: {
         userid: wx.getStorageSync('userid')
 
      },
      header: {
        'content-type': 'application/json'
      },
      success(res) {
        wx.hideLoading()
        console.log(res.data)
        var data = res.data
        if (data.status == "success") {
          var list = data.list
          that.setData({
            personalWebsite: list,
            stu_name: list.stu_name,
            hdname: list.hdname,
            qs: list.hdname,
            time:list.time

          })
        }
      }
    })
  },
  
})